import {} from 'react'
import { Button, Modal, Space } from 'antd'
import { VideoSchema } from './operateBtns/ajax'

interface Props {
  data: VideoSchema[]
  visible: boolean
  hide: () => void
}

function Main ({ data, visible, hide }: Props) {
  return (
    <Modal title='查看录像' visible={visible} maskClosable={false} onCancel={() => hide()} footer={<Button type='primary' onClick={() => hide()}>确定</Button>} >
      <div>
        {data.map((li, i) => {
          return (
            <div key={i} style={{ lineHeight: '28px' }}>
              <span>{i + 1}、{li.subject} {li.startTime}</span>
              <div style={{ marginLeft: '24px' }}>
                <Space>
                  {li.url.map((o, j) => {
                    return <a href={o} key={j} target='_blank'>视频{j+1}</a>
                  })}
                </Space>
              </div>
            </div>
          )
        })}
      </div>
    </Modal>
  )
}

export default Main